<template>
	<view class="p-3">
		<view class="title" style="clear: both;">
			<input class="uni-input" maxlength="10" placeholder="请输入反馈意见标题" style="background-color: #80808030;  margin: 0 auto; border-radius: 10rpx; padding:20rpx;font-size: 28rpx;" @input="onKeyInput" />
		</view>

		<view class="content" style="clear: both; padding-top: 10px;">
			<textarea placeholder-style="" style="background-color: #80808030;margin: 0 auto; border-radius: 10rpx; padding:20rpx;font-size: 28rpx;width: 640rpx;" placeholder="请输入反馈意见..." v-model="content" />
		</view>

		<view class="fixed-bottom mb-3 px-5 flex justify-between">
			<view class="flex rounded-circle bg-main colorfff align-center  justify-center px-4 py-1 font30"
				style="margin:0 auto;height: 60rpx;width: 200rpx;" @click="save">
				提交
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '',
				content: '',
				parentId: 0
			}
		},
		onLoad(options) {
			let _this = this;
			_this.parentId = options.parentId
		},
		methods: {
			onKeyInput(event) {
				let _this = this;
				_this.title = event.target.value
			},
			save() {
				let _this = this;
				let opts = {
					url: 'Message/addMessage.shtml'
				};
				let param = {
					jz_id: _this.parentId,
					vcTitle: _this.title,
					textContent: _this.content
				};
				_this.$http.httpRequest(opts, param).then(
					res => {
						console.log(res.data);
						if (res.data.code == '200') {
							uni.showToast({
								icon: 'success',
								title: res.data.msg
							});
						} else {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					},
					error => {
						console.log(error);
					}
				);
			}
		}
	}
</script>

<style>

</style>
